package com.lzy.product.constants;

import java.util.ArrayList;
import java.util.List;

public class OrderBusiConstants {

	// 订单业务类型代码
	public static final class Biz {
		/** 产品订单 */
		public static final String PRODUCT = "1";
		/** 卡券宝 */
		public static final String COUPONS = "2";
	}

	public enum OrderTypeEnum {
		PRODUCT(66, "产品管理");

		private Integer type;

		private String name;

		public Integer getType() {
			return type;
		}

		public void setType(Integer type) {
			this.type = type;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		private OrderTypeEnum(Integer type, String name) {
			this.type = type;
			this.name = name;
		}

		/**
		 * 获取name
		 * 
		 * @param type
		 * @return
		 */
		public static String getName(Integer type) {
			for (OrderTypeEnum c : OrderTypeEnum.values()) {
				if (c.getType().equals(type)) {
					return c.getName();
				}
			}
			return "";
		}
	}

	public enum PayStatusEnum {

		NOPAY(0, "未付款"), YESPAY(1, "已付款"), FAILPAY(2, "付款失败");

		private PayStatusEnum(Integer k, String v) {
			this.k = k;
			this.v = v;
		}

		private Integer k;
		private String v;

		public Integer getK() {
			return k;
		}

		public void setK(Integer k) {
			this.k = k;
		}

		public String getV() {
			return v;
		}

		public void setV(String v) {
			this.v = v;
		}

		/**
		 * 获取v
		 * 
		 * @param type
		 * @return
		 */
		public static String getV(Integer type) {
			for (PayStatusEnum c : PayStatusEnum.values()) {
				if (c.getK().equals(type)) {
					return c.getV();
				}
			}
			return "";
		}

	}

	public enum RefundEnum {
		// 0退货退款、1仅退款、2换货

		GOODANDMONEY(0, "退货退款"), MONEY(1, "仅退款"), GOOD(2, "换货");

		private RefundEnum(Integer k, String v) {
			this.k = k;
			this.v = v;
		}

		private Integer k;
		private String v;

		public Integer getK() {
			return k;
		}

		public void setK(Integer k) {
			this.k = k;
		}

		public String getV() {
			return v;
		}

		public void setV(String v) {
			this.v = v;
		}

		/**
		 * 获取v
		 * 
		 * @param k
		 * @return
		 */
		public static String getV(Integer k) {
			for (RefundEnum c : RefundEnum.values()) {
				if (c.getK().equals(k)) {
					return c.getV();
				}
			}
			return "";
		}

		/**
		 * 获取list
		 */
		public static List<InnerRefund> getEnumList() {
			List<InnerRefund> list = new ArrayList<InnerRefund>();
			for (RefundEnum c : RefundEnum.values()) {
				// TODO 单例
				list.add(c.new InnerRefund(c.getK(), c.getV()));

			}
			return list;
		}

		private class InnerRefund {
			// 值
			private Integer k;
			// 描述
			private String v;

			public Integer getK() {
				return k;
			}

			public void setK(Integer k) {
				this.k = k;
			}

			public String getV() {
				return v;
			}

			public void setV(String v) {
				this.v = v;
			}

			private InnerRefund(Integer k, String v) {
				super();
				this.k = k;
				this.v = v;
			}

		}

	}
	public enum VerifyStatusEnum {

		
		NOSHOW(0, "不显示"), VERIFY(1, "未审核"), YESVERIFY(2, "审核通过"), NOVERIFY(3, "审核未通过");

		private VerifyStatusEnum(Integer k, String v) {
			this.k = k;
			this.v = v;
		}

		private Integer k;
		private String v;

		public Integer getK() {
			return k;
		}

		public void setK(Integer k) {
			this.k = k;
		}

		public String getV() {
			return v;
		}

		public void setV(String v) {
			this.v = v;
		}

		/**
		 * 获取name
		 * 
		 * @param type
		 * @return
		 */
		public static String getV(Integer type) {
			for (VerifyStatusEnum c : VerifyStatusEnum.values()) {
				if (c.getK().equals(type)) {
					return c.getV();
				}
			}
			return "";
		}

	}

	public enum GoodsStatusEnum {
		NOSEND(0, "未发货"), YESSEND(1, "已发货");

		private GoodsStatusEnum(Integer k, String v) {
			this.k = k;
			this.v = v;
		}

		private Integer k;
		private String v;

		public Integer getK() {
			return k;
		}

		public void setK(Integer k) {
			this.k = k;
		}

		public String getV() {
			return v;
		}

		public void setV(String v) {
			this.v = v;
		}

		/**
		 * 获取v
		 * 
		 * @param type
		 * @return
		 */
		public static String getV(Integer type) {
			for (GoodsStatusEnum c : GoodsStatusEnum.values()) {
				if (c.getK().equals(type)) {
					return c.getV();
				}
			}
			return "";
		}
	}

	public enum CarActionTypeEnum {
		PICK(0, "提车"), RETURN(1, "还车");

		private CarActionTypeEnum(Integer k, String v) {
			this.k = k;
			this.v = v;
		}

		private Integer k;
		private String v;

		public Integer getK() {
			return k;
		}

		public void setK(Integer k) {
			this.k = k;
		}

		public String getV() {
			return v;
		}

		public void setV(String v) {
			this.v = v;
		}

		/**
		 * 获取v
		 * 
		 * @param type
		 * @return
		 */
		public static String getV(Integer type) {
			for (CarActionTypeEnum c : CarActionTypeEnum.values()) {
				if (c.getK().equals(type)) {
					return c.getV();
				}
			}
			return "";
		}
	}

}
